#include <iostream>
#include <cstring>
using namespace std;

int main()
{
    char num1[80];
    char num2[80];

    int count1 = 0;
    int count2 = 0;

    cin >> num1;
    cin >> num2;
    if (strlen(num1) != strlen(num2))
    {
        cout << "no" << endl;
        return 0;
    }
    for (int i = 0; i < strlen(num1); i++)
    {
        num1[i] = char(tolower(num1[i]));
        num2[i] = char(tolower(num2[i]));
    }

    for (int i = 0; i < strlen(num2); i++)
    {
        char letter = num1[i];
        count1 = 0;
        count2 = 0;
        for (int j = 0; j < strlen(num1); j++)
        {
            if (num1[j] == letter)
            {
                count1++;
            }
        }
        for (int k = 0; k < strlen(num1); k++)
        {
            if (num2[k] == letter)
            {
                count2++;
            }
        }
        if (count1 != count2)
        {
            cout << "no" << endl;
            return 0;
        }
    }
    cout << "yes" << endl;
    return 0;
}